#ifndef MYSYSTEMTRAYICON_H
#define MYSYSTEMTRAYICON_H

#include <QObject>
#include <QSystemTrayIcon>  //系统托盘类
#include <QMenu>

class MySystemTrayIcon : public QObject
{
    Q_OBJECT
public:
    explicit MySystemTrayIcon(QObject *parent = 0);
    ~MySystemTrayIcon();

    Q_INVOKABLE void setIcon(QString url);          //设置托盘图标
    Q_INVOKABLE void setToolTip(QString toolTip);   //设置鼠标滑过时显示字符
    Q_INVOKABLE void show();
    Q_INVOKABLE void hide();
    // 显示信息
    Q_INVOKABLE void showMessage(QString tital, QString msg, int timeOut = 10000,
                     QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information);

signals:
    void sig_actionMin();
    void sig_actionNormal();
    void sig_actionQuit();
public slots:
private:
    QSystemTrayIcon *trayIcon;  //系统托盘实例
    QMenu *trayIconMenu;
};

#endif // MYSYSTEMTRAYICON_H
